package UI;
import facecat.topin.core.*;
import facecat.topin.btn.*;
import java.util.*;

/*
 * 周期按钮
 */
public class CycleButton extends FCButton {
    public CycleButton()
       {
           setFont(new FCFont("Default", 14));
       }

       public int m_cycle;

       public MyChart m_chart;

       public long getPaintingTextColor()
       {
           if (MyColor.m_style == 0)
           {
               return FCColor.rgb(200, 200, 200);
           }
           return super.getPaintingTextColor();
       }

       public void onPaintForeground(FCPaint paint, FCRect clipRect)
       {
           int width = getWidth(), height = getHeight();
           int cWidth = clipRect.right - clipRect.left;
           paint.drawLine(FCColor.Border, 1, 0, width - 1, 5, width - 1, height - 5);
           if (m_chart != null && m_chart.m_cycle != 0 && m_chart.m_cycle == m_cycle)
           {
               paint.fillRect(FCColor.Pushed, 1, 1, width - 1, height - 1);
               paint.drawRect(MyColor.USERCOLOR109, 1, 0, 1, 1, width - 1, height - 1);
           }
           super.onPaintForeground(paint, clipRect);
       }
}

